<template>
   <div class="pbox">
      <div>{{fromChildMsg}}</div>
      <child :fmsg="fmsg" @giles="getMsgFromChild"></child>
   </div>
</template>

<script>
import Child from './Child.vue'

export default {
    components:{Child},
    data(){
        return{
            fmsg:'父亲传递数据到儿子',
            fromChildMsg:''
        }
    },
    methods:{
        getMsgFromChild(msg){
            console.log('父组件中：',msg);
            this.fromChildMsg=msg
        }
    }
}
</script>

<style lang="scss">
    @import '@/assets/global.scss';
    .pbox{
        @include flex-center;
        width: 150px;
        height: 150px;
        background-color: tomato;
    }
</style>